<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html xmlns:th="http://www.thymeleaf.org"> 
<head>
    <title>发表评价</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="description" content="Write an awesome description for your new site here. You can edit this line in _config.yml. It will appear in your document head meta (for Google search results) and in your feed.xml site description.">
    <link rel="stylesheet" href="lib/weui.min.css">
    <link rel="stylesheet" href="css/jquery-weui.css">
    <link rel="stylesheet" href="css/style.css">
</head>
<body ontouchstart>
<header class="wy-header">
    <div class="wy-header-icon-back" onclick="back();"><span></span></div>
    <div class="wy-header-title">发表评价</div>
</header>

<div class="weui-content clear" >
    <!--获取session中的userid,orderId,goodsId-->
    <form action="evaluate.htm" method="post" id="eval" enctype="multipart/form-data">
        <input type="hidden" id="userid" th:value="${userId}" name="userId"/>
        <!--获取订单ID-->
        <input type="hidden" id="id" th:value="${id}" name="id"/>
        <!--商品评价等级-->
    <div class="order-list-Below clear" id="goodsEvaluate1">
        <input type="hidden" name="goodsEvaluate" id="goodsEvaluate"/>
        <h1>商品评价</h1>
        <ul>
            <li class="on"></li>
            <li class="on"></li>
            <li class="on"></li>
            <li class="on"></li>
            <li class="on"></li>
        </ul>
    </div>
        <!--物流评价等级-->
    <div class="order-list-Below clear" id="physicalEvaluate1">
        <input type="hidden" name="physicalEvaluate" id="physicalEvaluate"/>
        <h1>物流评价</h1>
        <ul>
            <li class="on"></li>
            <li class="on"></li>
            <li class="on"></li>
            <li class="on"></li>
            <li class="on"></li>
        </ul>
    </div>
        <!--商家评价等级-->
    <div class="order-list-Below clear" id="merchantAttitude1">
        <input type="hidden" name="merchantAttitude" id="merchantAttitude"/>
        <h1>商家评价</h1>
        <ul>
            <li class="on"></li>
            <li class="on"></li>
            <li class="on"></li>
            <li class="on"></li>
            <li class="on"></li>
        </ul>
    </div>
    <div class="weui-cells weui-cells_form com-txt-area">
        <div class="weui-cell">
            <div class="weui-cell__bd">
                <!--获取评价信息-->
                <textarea class="weui-textarea txt-area" placeholder="这个商品满足你的期待吗？说说你的使用心得，分享给想买的他们吧" rows="3" name="evaluateDse"></textarea>
                <div class="weui-textarea-counter font-12 num"><span>0</span>/200</div>

            </div>
        </div>
    </div>
    <div class="weui-cells weui-cells_checkbox commg">
        <label class="weui-cell weui-check__label" for="s11">
            <div class="weui-cell__hd">
                <!--判断是否匿名-->
                <input type="hidden" name="anonymityType" id="anonymityType"/>
                <input type="checkbox" class="weui-check" name="checkbox1" id="s11" checked="checked">
                <i class="weui-icon-checked"></i>
            </div>
            <div class="weui-cell__bd"><p>匿名评价</p></div>
        </label>
    </div>
    <div class="weui-cells weui-cells_form">
        <div class="weui-cell">
            <div class="weui-cell__bd">
                <div class="weui-uploader">
                    <div class="weui-uploader__hd">
                        <p class="weui-uploader__title font-14">图片上传</p>
                        <div class="weui-uploader__info font-12">0/2</div>
                    </div>
                    <div class="weui-uploader__bd">
                        <!--<ul class="weui-uploader__files" id="uploaderFiles">-->
                            <!--<li class="weui-uploader__file" style="background-image:url(images/pic_160.png)"></li>-->
                            <!--<li class="weui-uploader__file" style="background-image:url(images/pic_160.png)"></li>-->
                            <!--<li class="weui-uploader__file" style="background-image:url(images/pic_160.png)"></li>-->
                            <!--<li class="weui-uploader__file weui-uploader__file_status" style="background-image:url(images/pic_160.png)">-->
                                <!--<div class="weui-uploader__file-content">-->
                                    <!--<i class="weui-icon-warn"></i>-->
                                <!--</div>-->
                            <!--</li>-->
                            <!--<li class="weui-uploader__file weui-uploader__file_status" style="background-image:url(images/pic_160.png)">-->
                                <!--<div class="weui-uploader__file-content">50%</div>-->
                            <!--</li>-->
                        <!--</ul>-->
                        <div class="weui-uploader__input-box">
                            <input id="uploaderInput" class="weui-uploader__input" type="file" accept="image/*" multiple="" name="items_pic">
                        </div>
                        <div class="weui-uploader__input-box">
                            <input id="uploaderInput" class="weui-uploader__input" type="file" accept="image/*" multiple="" name="items_pic">
                        </div>
                        <div class="weui-uploader__input-box">
                            <input id="uploaderInput01" class="weui-uploader__input" type="file" accept="image/*" multiple="" name="items_pic">
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="com-button"><a href="javascript:;" onclick="abc()">发表评价</a></div>

    </form>
</div>


<script src="lib/jquery-2.1.4.js"></script>
<script src="lib/fastclick.js"></script>
<script type="text/javascript" src="js/jquery.Spinner.js"></script>
<script>
    $(function() {
        FastClick.attach(document.body);
    });
</script>
<script src="js/jquery-weui.js"></script>
<!--获取商品评价分数-->
<script type="text/javascript">
    $("#goodsEvaluate1 ul li").click(
        function(){
            var num0;
            var num = $(this).index()+1;
            var len = $(this).index();
            var thats = $(this).parent(".order-list-Below ul").find("li");
            if($(thats).eq(len).attr("class")=="on"){
                if($(thats).eq(num).attr("class")=="on"){
                    $(thats).removeClass();
                    for (var i=0 ; !(i >= num); i++) {
                        $(thats).eq(i).addClass("on");
                    }
                }else{
                    $(thats).removeClass();
                    for (var k=0 ; !(k >= len); k++) {
                        $(thats).eq(k).addClass("on");
                    }
                    num0=num-1;

                    $("#goodsEvaluate").val(num0);
                    //alert($("#goodsEvaluate").val());
                }
            }else{
                $(thats).removeClass();
                for (var j=0 ; !(j >= num); j++) {
                    $(thats).eq(j).addClass("on");
                }
                num0=num;
                $("#goodsEvaluate").val(num0);
                //alert($("#goodsEvaluate").val());
            }
        }
    );
</script>

<!--获取物流评价分数-->
<script type="text/javascript">
    $("#physicalEvaluate1 ul li").click(
        function(){
            var num0;
            var num = $(this).index()+1;
            var len = $(this).index();
            var thats = $(this).parent(".order-list-Below ul").find("li");
            if($(thats).eq(len).attr("class")=="on"){
                if($(thats).eq(num).attr("class")=="on"){
                    $(thats).removeClass();
                    for (var i=0 ; !(i >= num); i++) {
                        $(thats).eq(i).addClass("on");
                    }
                }else{
                    $(thats).removeClass();
                    for (var k=0 ; !(k >= len); k++) {
                        $(thats).eq(k).addClass("on");
                    }
                    num0=num-1;
                    $("#physicalEvaluate").val(num0);
                   // alert( $("#physicalEvaluate").val());
                }
            }else{
                $(thats).removeClass();
                for (var j=0 ; !(j >= num); j++) {
                    $(thats).eq(j).addClass("on");
                }
                num0=num;
                $("#physicalEvaluate").val(num0);
               // alert( $("#physicalEvaluate").val());
            }
        }
    );
</script>

<!--获取商家评价分数-->
<script type="text/javascript">
    $("#merchantAttitude1 ul li").click(
        function(){
            var num0;
            var num = $(this).index()+1;
            var len = $(this).index();
            var thats = $(this).parent(".order-list-Below ul").find("li");
            if($(thats).eq(len).attr("class")=="on"){
                if($(thats).eq(num).attr("class")=="on"){
                    $(thats).removeClass();
                    for (var i=0 ; !(i >= num); i++) {
                        $(thats).eq(i).addClass("on");
                    }
                }else{
                    $(thats).removeClass();
                    for (var k=0 ; !(k >= len); k++) {
                        $(thats).eq(k).addClass("on");
                    }
                    num0=num-1;

                    $("#merchantAttitude").val(num0);
                    //alert($("#merchantAttitude").val());
                }
            }else{
                $(thats).removeClass();
                for (var j=0 ; !(j >= num); j++) {
                    $(thats).eq(j).addClass("on");
                }
                num0=num;

                $("#merchantAttitude").val(num0);
               // alert($("#merchantAttitude").val());
            }
        }
    );
    function back() {
        window.location.href=document.referrer;
    }
</script>

<!--获取匿名评价-->
<script type="text/javascript">
    function abc() {
        var tp ;
        if ($("#s11").is(":checked")) {
            tp = "是";
        } else {
            tp = "否";
        }
        $("#anonymityType").val(tp);
        $("#eval").submit();
        $("#merchantAttitude").val();

    }


</script>
</body>
</html>